package com.bcbim.operation_maintenance.table_head.service;

import com.bcbim.operation_maintenance.table_head.mapper.SpaceDepartmentTableHeadMapper;
import com.bcbim.operation_maintenance_interface.table_head.dao.SpaceDepartmentTableHeadDAO;
import com.bcbim.operation_maintenance_interface.table_head.dto.TableCheckDTO;
import com.bcbim.operation_maintenance_interface.table_head.service.SpaceDepartmentTableHeadService;
import com.bcbim.operation_maintenance_interface.table_head.vo.SpaceDepartmentTableHeadVO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @version V 1.0.0
 * @Description：业务部门表头设置
 * @Author: haomeijie
 * @Date: 2022/3/9 13:43
 **/
@Service(timeout = 60 * 1000, group = "spaceDepartment", version = "1.0.0")
public class SpaceDepartmentTableHeadServiceImpl implements SpaceDepartmentTableHeadService {
    @Autowired
    private SpaceDepartmentTableHeadMapper spaceDepartmentTableHeadMapper;

    @Override
    public boolean checkTableHeadByUserId(TableCheckDTO tableCheckDTO) {
        int count = spaceDepartmentTableHeadMapper.checkTableHeadByUserId(tableCheckDTO);
        return count > 0 ? true : false;
    }

    @Override
    public List<SpaceDepartmentTableHeadVO> listTableHead(TableCheckDTO tableCheckDTO) {
        return spaceDepartmentTableHeadMapper.listTableHead(tableCheckDTO);
    }

    @Override
    public int batchInsertTableHead(List<SpaceDepartmentTableHeadDAO> list) {
        return spaceDepartmentTableHeadMapper.batchInsertTableHead(list);
    }

    @Override
    public int batchUpdateTableHead(List<SpaceDepartmentTableHeadDAO> list) {
        return spaceDepartmentTableHeadMapper.batchUpdateTableHead(list);
    }

    @Override
    public int batchNoChecked(TableCheckDTO tableCheckDTO) {
        return spaceDepartmentTableHeadMapper.batchNoChecked(tableCheckDTO);
    }
}
